﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Bing.Service;

namespace Microsoft.Bing
{
    /// <summary>
    /// Defines a contract for an object which is capable of executing asychronous <see cref="SearchRequest">SearchRequests</see>
    /// and other services, such as a query time elapsed metric
    /// </summary>
    public interface ISearchEngine
    {
        /// <summary>
        /// Specifies an event which will fire when a search in completed
        /// </summary>
        event EventHandler<SearchResponseEventArgs>              SearchCompleted;

        /// <summary>
        /// Specifies an event which will fire when an error ocurrs while executing a search
        /// </summary>
        event EventHandler<ErrorEventArgs>                       Error;

        /// <summary>
        /// Specifies a TimeSpan property which returns the time elapsed for the last executed query
        /// </summary>
        TimeSpan QueryTimeElapsed { get; }

        /// <summary>
        /// Defines a method for beginning the execution of an asynchronous search
        /// </summary>
        void BeginSearch(SearchRequest search);
    }
}
